<%@ Control Language="C#" AutoEventWireup="true" CodeFile="Comments.ascx.cs" Inherits="Beta_fundies_controls_comments_Comments" %>
<asp:Repeater runat="server" ID="gridComments">
    <ItemTemplate>
        <a name="<%# Eval("ID") %>"></a>
        <table width="100%" bgcolor='<%# GetBgColor((bool)Eval("Visible")) %>'>
            <tr>
                <td width="25%" align="left" valign="top">
                    <asp:Literal runat="server" ID="ltrPost"
                        Text='<%# Helpers.StringHelper.SafeFormat("<p><a target=\"_blank\" href=\"comments.aspx?q={0}\">[{0}]</a></p>", Eval("Quote.ID")) %>'
                        Visible='<%# ShowQuoteLink %>' />
                    <p>
                        <%# Helpers.StringHelper.SafeFormat(Eval("Author")) %>
                    </p>
                    <p>
                        #<%# Helpers.StringHelper.SafeFormat(Eval("ID")) %>
                    </p>
                    <asp:Panel runat="server" ID="pnlMod"
                        Visible='<%# ShowModPanel() %>'>
                        <p>
                            IPAddress:
                            <asp:HyperLink runat="server" ID="lnkIP"
                                Text='<%# Helpers.StringHelper.SafeFormat(Eval("IPAddress")) %>'
                                NavigateUrl='<%# Helpers.StringHelper.SafeFormat("~/fundies/ip.aspx?c={0}", Eval("ID")) %>'
                                Target="_blank"/>
                        </p>
                    </asp:Panel>
                </td>
                <td width="75%" align="left" valign="top">
                    <p>
                        <%# Convert.ToDateTime(Eval("DatePosted")).ToString("yyyy-MMM-dd hh:mm tt")%>
                    </p>
                    <p>
                        <%# DAL.YCodes.Format(Eval("Post") as string) %>
                    </p>
                    
                    <asp:Panel runat="server" ID="pnlEdit"
                        Visible='<%# ShowEditPanel(Eval("IPAddress") as string, Convert.ToDateTime(Eval("DatePosted"))) %>'>
                        <asp:HyperLink runat="server" ID="lnkEdit"
                        Text="Edit Comment"
                        Target="editcomment"
                        NavigateUrl='<%# Helpers.StringHelper.SafeFormat("~/fundies/editcomment.aspx?c={0}", Eval("ID")) %>' />
                    </asp:Panel>
                </td>
            </tr>
        </table>
    </ItemTemplate>
    <SeparatorTemplate>
        <hr />
    </SeparatorTemplate>
</asp:Repeater>